home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat3 / read.3 < prev    next >
Encoding:
Text File  |  1993-03-03  |  1.9 KB  |  67 lines

  1.  
  2.  
  3.  
  4. READ(3)             MINTLIB LIBRARY FUNCTIONS             READ(3)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        read - read input
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        #include <unistd.h>
  12.  
  13.        int read(int fd, void *buffer, unsigned int length);
  14.  
  15. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  16.        read  attempts  to read length bytes of data from the file
  17.        referenced by the descriptor fd into the buffer pointed to
  18.        by buffer.
  19.  
  20.        On  objects capable of seeking, the read starts at a posi-
  21.        tion given by the pointer associated with fd (see  lseek).
  22.        Upon  return  from read, the pointer is incremented by the
  23.        number of bytes actually read.
  24.  
  25.        Objects that are not capable of seeking always  read  from
  26.        the  current position. The value of the pointer associated
  27.        with such an object is undefined.
  28.  
  29.        Upon successful completion, read  returns  the  number  of
  30.        bytes  actually  read and placed in the buffer. The system
  31.        guarantees to read the number of bytes  requested  if  the
  32.        descriptor  references  a  normal file which has that many
  33.        bytes left before the EOF (end of file), but in  no  other
  34.        case.
  35.  
  36.        If  nbytes  is  not  zero and read returns 0, then EOF has
  37.        been reached.
  38.  
  39.        If the descriptor or the object is marked for non-blocking
  40.        I/O, and less data are available than are requested by the
  41.        read, only the data that are available are  returned,  and
  42.        the  count  indicates how many bytes of data were actually
  43.        read.
  44.  
  45. R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
  46.        read returns the number of bytes actually read on success.
  47.        On  failure,  it returns -1 and sets errno to indicate the
  48.        error.
  49.  
  50. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  51.        d✓du✓up✓p(✓(3✓3)✓),✓, f✓fc✓cn✓nt✓tl✓l(✓(3✓3)✓),✓, i✓io✓oc✓ct✓tl✓l(✓(3✓3)✓),✓, l✓ls✓se✓ee✓ek✓k(✓(3✓3)✓),✓, o✓op✓pe✓en✓n(✓(3✓3)✓),✓, p✓pi✓ip✓pe✓e(✓(3✓3)✓)
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. MiNT docs 0.1              3 March 1993                         1
  65.  
  66.  
  67.